package com.xywy.me;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;

import com.xywy.R;
import com.xywy.common.BaseActivity;
import com.xywy.common.widget.TitleBar;
import com.xywy.me.adapter.JtcyAdapter;
import com.xywy.me.bean.Jtcy;

import java.util.ArrayList;
import java.util.List;

/**
 * 我 - 家庭成员 - 提醒类型
 * @author xiaogd
 *
 */
public class JtcytxActivity extends BaseActivity{
    private static final String  TAG = "JtcyActivity";
    private ListView  lv;
    private JtcyAdapter adapter;
    private  TextView tvGo;
    @Override
    protected void onCreate(Bundle savedInstanceState)  
    {
    	super.onCreate(savedInstanceState);    
        //设置为全屏
        requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.me_jtcy);

        this.preInit();
        this.initView();
        this.loadData();
        this.setListener();
    }

    @Override
    protected void onResume() {
        super.onResume();

    }

    @Override
    protected void onPause() {
        super.onPause();

    }

    @Override
    public void preInit() {

    }

    @Override
    public void loadData() {
         List<Jtcy> jtcyList = new ArrayList<Jtcy>();

         adapter = new JtcyAdapter(this);
         adapter.setData(jtcyList);
         lv.setAdapter(adapter);
    }

    @Override
    public void initView() {
        //title
        TitleBar titleBar = (TitleBar)findViewById(R.id.me_jtcy_title_bar);
        titleBar.onClickBack(this);
        titleBar.setTitleBarBackGroud(R.color.start_bt_bg);
            TextView tvTitle= titleBar.getTitle();
            TextView tvBack= titleBar.getTvBack();
            tvGo= titleBar.getGo();
            Button back = titleBar.getBack();
            tvTitle.setText(getString(R.string.me_jtcy));
            tvBack.setText(getString(R.string.me_infor_back));
            tvGo.setText(getString(R.string.find_remind_add));
            tvTitle.setTextColor(getResources().getColor(R.color.white));
        tvBack.setTextColor(getResources().getColor(R.color.white));
        tvGo.setTextColor(getResources().getColor(R.color.white));
        back.setBackgroundDrawable(getResources().getDrawable(R.drawable.titlebar_back));

        lv = (ListView)this.findViewById(R.id.lv_me_jtcy);
    }

    private void setListener(){
        tvGo.setOnClickListener(onClickListener);
    }

    View.OnClickListener  onClickListener = new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent intent =new Intent(JtcytxActivity.this,JtcyAddActivity.class);
              startActivity(intent);
        }
    };

}



